# handler_periodical.py
#
#

""" gozerwave perdiocal handler. """

## gozerlib imports 

from gozerlib.utils.generic import getversion
from gozerlib.plugins import plugs

## google imports

from google.appengine.ext import webapp
from google.appengine.ext.webapp.util import run_wsgi_app

## basic imports

import logging

periodicals =  ['waveplugs.rss', ]


class PeriodicalHandler(webapp.RequestHandler):

    """ run periodical every second """

    def get(self):
        plugs.periodicals = periodicals
        plugs.periodical()

application = webapp.WSGIApplication([('/tasks/periodical', PeriodicalHandler)],
                                      debug=True)

def main():
    global application
    logging.info(getversion('PERIODICAL'))
    run_wsgi_app(application)

if __name__ == "__main__":
    main()
